<script setup>
import { useRouter } from "vue-router";

const router = useRouter();
if (localStorage.getItem('token')) {
  router.push('/'); // token存在则直接跳转到主页
} else {
  router.push('/login'); // token不存在则跳转到登录页
}
</script>

<template>
  <router-view />
</template>

<style scoped></style>
